package com.xci.platform.auth.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.xci.platform.core.Constant;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统序列
 */
@Data
public class SequenceEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 序列主键
     */
    @NotBlank(message = "序列主键不能为空")
    @ExcelIgnore
    private String id;

    /**
     * 序列编码
     */
    @NotBlank(message = "序列编码不能为空")
    @Excel(name = "序列编码",width = 15)
    private String code;

    /**
     * 序列名称
     */
    @NotBlank(message = "序列名称不能为空")
    @Excel(name = "序列名称",width = 15)
    private String name;

    /**
     * 开始值
     */
    @Range(min = 0,max = 999999999,message = "开始值必须在{min}和{max}之间")
    @Excel(name = "开始值")
    private Integer seqStart;
  
    /**
     * 当前值
     */
    @Excel(name = "当前值")
    private Long seqValue;
  
    /**
     * 增量
     */
    @Range(min = 0,max = 99999999,message = "开始值必须在{min}和{max}之间")
    @Excel(name = "增量")
    private Integer seqStep;
  
    /**
     * 模板
     */
    @Length(min = 0, max = 2000, message = "模板不能超过{max}个字符")
    @Excel(name = "模板",width = 15)
    private String tpl;

    /**
     * 操作用户主键
     */
    @ExcelIgnore
    private String operateUserId;

    /**
     * 操作用户
     */
    @Excel(name = "操作用户")
    private String operateUserName;

    /**
     * 操作日期
     */
    @Excel(name = "操作日期",width = 20, exportFormat = Constant.DefaultDateTimePattern)
    private Date operateDateTime;

    /**
     * 备注
     */
    @Length(min = 0, max = 2000, message = "备注不能超过{max}个字符")
    @Excel(name = "备注",width = 20)
    private String remark;
  
}
